﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MVCFoto.IDAL;

namespace MVCFoto.BLL
{
    public class AppLog
    {
        private static readonly IAppLog dal = MVCFoto.DALFactory.Factory.Create<IAppLog>("AppLog");

        public static bool Add(int userId, Nodes node, LogTypes logType, string comment, DateTime operateDate)
        {
            return dal.Add(userId, node.ToString(), logType.ToString(), comment, operateDate);
        }

        public static bool Add(int userId, Nodes node, LogTypes logType, string comment)
        {
            return Add(userId, node, logType, comment,DateTime.Now);
        }

        public static bool Add(Nodes node, LogTypes logType, string comment)
        {
            return Add(0, node, logType, comment, DateTime.Now);
        }

        /// <summary>
        /// 应用程序节点
        /// </summary>
        public enum Nodes
        { 
            Config
        }

        public enum LogTypes
        {
            New,
            Save,
            Open,
            Delete,
            Publish,
            SendToPublish,
            UnPublish,
            Move,
            Copy,
            AssignDomain,
            PublicAccess,
            Sort,
            Notify,
            Login,
            Logout,
            LoginFailure,
            System,
            Debug,
            Error,
            NotFound,
            RollBack,
            PackagerInstall,
            PackagerUninstall,
            Ping,
            SendToTranslate,
            ScheduledTask
        }
    }
}
